﻿@model List<HotDealD2.Models.ModelView.OrderDealView>
@helper Truncate(string input, int length)
 {
    if (input.Length <= length) {
        @input
    } else {
        @input.Substring(0, length)<text>...</text>
    }
}
@{
    Layout = "../../Shared/AdminLayout.cshtml";
}
@{
    ViewBag.Title = "Index";
    ViewBag.Username = "Admin";
}

	<div class= "body-content" >

		<div class ="right-cont">
		
		<div id="contented">
        <div class="bg_account_T">
        Quản Lý Đơn Đặt Hàng
    </div>
     @using (Html.BeginForm())
     {
	   <div class="box-profile">
       <fieldset>
         <legend>Thông Tin Đơn Đặt Hàng</legend>

       <div class="middle-box">
	   <table  >
           <tr>
             <td style="vertical-align: bottom;">
					<span class="style1">Page <b>1</b> / 1			| Display
						<select name="pagination"><option value="20">20</option><option value="50" selected="selected">50</option><option value="100">100</option><option value="300">300</option>
						</select>
						/ 3 result(s)
					</span>
					<span style="float: right;">
                    <div class="field">	  
                   
                    
						<input type="submit" id="submitFilterButton_customer" name="submitFilter" value="Filter"  />
                    
                        </div>
					</span>
					<span class="clear"></span>
				</td>
    
           </tr>
           <tr>
             <td height="74">
			 <table class="table">
               <tr>
               
               		<th width="41" height="55">
                    <div class="center">
				        <input type="checkbox"/>
                        </div>				 
                    </th>
					<th width="77">
                    <div class="center"><span class="style1">ID</span> <br />
						<a href=""><img border="0" src="../../Content/AdminSite/images/button/down.gif" /></a>
						<a href=""><img border="0" src="../../Content/AdminSite/images/button/up.gif" /></a>
                        </div>
                    </th>
                    
					<th width="96">
                    <div class="center"><span class="style1">
					Khách Hàng					</span></div></th>
                    <th width="96">
                    <div class="center"><span class="style1">
					Sản Phẩm					</span></div></th>
                    <th width="96">
                    <div class="center"><span class="style1">
					Số Lượng					</span></div></th>
					<th width="130"><div class="center"><span class="style1">
					Tổng Tiền					</span></div></th>
					<th width="130"><div class="center"><span class="style1">
					Trạng Thái					</span></div></th>
                    <th width="130"><div class="center"><span class="style1">
					Điều Khiển					</span></div></th>
               </tr>
               <tr style="height:35px;">
			   <td>
			    <div class="center">
					<span class="style1">--</span>
				</div>
				</td>
                <td> <div class="center">
					<span class="style1">--</span></td>
                 <td >
				 <div class="center">
                   @Html.TextBox("searchString",null,new { @class = "f-input", style="width:70px;"}) 
					
				</div>
                </td>
                 <td> <div class="center">
					<span class="style1">--</span>
				</div>
			    </td>
                 <td> <div class="center">
					<span class="style1">--</span>
				</div></td>
                <td> <div class="center">
					<span class="style1">--</span>
				</div></td>
                
				  <td> <div class="center">
					<span class="style1">--</span>
				</div></td>
                 <td> <div class="center">
					<span class="style1">--</span>
				</div></td>
                
             
                </tr>
                @foreach (var item in Model)
                {
                   
               <tr>
                 <td width="41" height="55"><div class="center">
				  <input type="checkbox"/>	</div>			  </td>
					<td width="79"><div class="center"><span class="style1">
					@Html.DisplayFor(m => item.MaDonHang)</span></div></td>
					<td width="79"><div class="center"><span class="style1">
					@Html.DisplayFor(m => item.ThanhVien.Username)</span></div></td>
					<td width="150"><div class="center">
                    @foreach (var a in item.DanhSachSanPham)
                     {
                    <span class="style1">
					    @Truncate(a.Deal.TenDeal,15)</span><br />}</div></td>
                    <td width="79"><div class="center">
                     @foreach (var a in item.DanhSachSanPham)
                     {
                    <span class="style1">
					    @Html.DisplayFor(m => a.SoLuong)</span><br />}
					</div></td>
					
					
					<td width="79"><div class="center"><span class="style1">
					@Html.DisplayFor(m => item.TongCong)</span></div></td>
                    <td width="79"><div class="center"><span class="style1">
					@Html.DisplayFor(m => item.TinhTrang)</span></div></td>
                    <td width="96">
		
                    <div class ="center">
                   <a href=""><img src="../../../Content/AdminSite/images/button/details.gif" title ="Xem Chi Tiết" /></a>
                    <a href="@Url.Action("UpdateOrder", new { id = item.MaDonHang })"><img src="../../../Content/AdminSite/images/button/edit.gif" title ="Cập Nhật"  /></a>
                    <a href="@Url.Action("DeleteOrder", new { id = item.MaDonHang })"><img src="../../../Content/AdminSite/images/button/delete.gif" title ="Xoá" /></a>
                    </div>
               
                    </td>
              
                </tr>
                }
               
             </table></td>
		   </tr>
		   </table>
          </div>
	   </fieldset>
		</div>
     }
		</div>
		</div>
	</div>